package com.kukudexin.time.mayikt.method;

import com.kukudexin.time.mayikt.service.MayiktService;

import java.util.Optional;
/**
 * @author: 酷酷的鑫
 * @Date: 2022/1/12 16:58
 * @description:
 */
public class ObjMethodImport {
    public static void main(String[] args) {
//        ObjMethodImport objMethodImport = new ObjMethodImport();
//        MayiktService mayiktService = objMethodImport1 -> objMethodImport1.objGet();
//        System.out.println(mayiktService.get(objMethodImport));


//        MayiktService mayiktService = (objMethodImport) -> objMethodImport.objGet();
//        System.out.println(mayiktService.get(new ObjMethodImport()));
        MayiktService mayiktService = ObjMethodImport::objGet;
        System.out.println(mayiktService.get(new ObjMethodImport()));
        String username =null;
        Optional<String> optional = Optional.ofNullable(username);
        System.out.println(optional.isPresent());
    }

    public String objGet() {
        return "mayikt";
    }
}
